


<?php foreach($data as $d): ?>
    <?php if($type=='trades'):?>
        <!--            交易记录-->
        <li>

            <span style="padding-left: 20px; float: right; color: green;padding-top: 3.5%">
               <?php if($d->is_get_redpack==1 || $d->get_redpack_type==TradeDetail::GET_REDPACK_TYPE6):?>
                   已领取
               <?php elseif($d->get_redpack_type==TradeDetail::GET_REDPACK_TYPE1 && $d->is_get_redpack==0 && $d->amount_due>=TradeDetail::LIMIT_AMOUNT) :?>

                   <button class="get_discount_botton" onclick="getRedPack(this,<?= $d->id_tradedetail?>,<?= $d->id_merchant?>)">

                   领取
                    </button>
               <?php endif;?>
            </span>

            <?php echo date('Y-m-d H:i', strtotime($d->createtime)); ?><br />
            <span style="color: #aaa; font-size: 12px;">
                                        在 <?php echo $d->merchant_name;  ?>消费

                    </span>
        </li>


    <?php else:?>
        <!-- 红包记录-->
        <li>
            <span style="background: url('/resources/frontend/images/dollor-small.png') no-repeat; background-size: 10px; background-position: left center; padding-left: 20px; float: right; font-size: 15px; line-height: 40px; color: #e82e2e;">
                <?php echo $d->bonus; ?>元
            </span>
            <?php echo date('Y-m-d H:i', strtotime($d->createtime)); ?><br />
            <span style="color: #aaa; font-size: 12px;">
                在 <?php echo $d->merchant_name;  ?>
                <?php echo $type == 'uses'? '使用' : '获得'; ?>红包
            </span>
        </li>
    <?php endif;?>
<?php endforeach; ?>


<?php if($isend):?>
    <li style="text-align: center; color: #a7a7a7; border: none; font-size: 12px;" class="isend">
        到底了，木有了~~
    </li>
<?php endif;?>